<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var str = '';
        var arr = ['red','green','blue','pink'];
        for(var i = 0; i < arr.length;i++){
            str = str  + arr[i] + '|';
        }
        console.log(str);
    </script>
</head>
<body>
    
</body>
</html>